<?php

declare (strict_types=1);

namespace app\validate\auth;

use think\Validate;

class Role extends Validate
{
    protected $rule = [
        'pid' => 'require|integer',
        'name' => 'require|chsAlpha|length:0,20|unique:app\common\model\Role',
        'status' => 'require|integer|in:0,1'
    ];

    /**
     * 场景
     */
    protected $scene = [
        'addRole' => ['pid', 'name', 'status']
    ];

    /**
     * 字段描述信息
     */
    protected $field = [
        'pid' => '父级',
        'name' => '角色名称',
        'status' => '角色状态'
    ];
}
